package com.xinlu.common.game.dao;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import com.xinlu.derek.common.BaseDao;
import com.xinlu.persistence.ScSjgl;
import com.xinlu.persistence.WcSjgl;

public class ScSjglDao extends BaseDao {

	public List getLottyList(Timestamp currentTime, String yxms) {

		String hql = " from ScSjgl sc where sc.dgjssj > ? and sc.yxms = ?  ";

		return super.find(hql, new Object[] { currentTime, yxms });

	}

	/**
	 * 
	 * Function : 获取当前期的详细信息
	 * 
	 * @param currenttTimestamp
	 * @return Derek 2011-5-21 下午03:37:05
	 */
	public ScSjgl getNewQishuXinxi(Date currenttTimestamp, String yxms) {

		String hql = " from ScSjgl sc where ? between sc.dgkssj and sc.dgjssj and sc.yxms = ? ";

		List list = super.find(hql, new Object[] { currenttTimestamp, yxms });

		return list != null && list.size() > 0 ? (ScSjgl) list.get(0) : null;
	}

	/**
	 * 加载第一条三彩时间记录
	 * 
	 * @return
	 */
	public ScSjgl loadTopOne(String yxms) {
		String cmdText = "from ScSjgl sc where sc.yxms='" + yxms + "'";

		List list = super.find(cmdText);

		return list != null && list.size() > 0 ? (ScSjgl) list.get(0) : null;
	}

}